# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
maintainer="team/kde <bribbers@disroot.org>"
pkgname=qqc2-desktop-style
pkgver=6.7.0
pkgrel=0
pkgdesc="A style for Qt Quick Controls 2 to make it follow your desktop theme"
# armhf blocked by qt6-qtdeclarative
arch="all !armhf"
url="https://community.kde.org/Frameworks"
license="LGPL-3.0-only AND (GPL-2.0-only OR GPL-3.0-only)"
depends="sonnet"
depends_dev="
	kconfigwidgets-dev
	kiconthemes-dev
	kirigami-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
checkdepends="
	kirigami
	xvfb-run
	"
install_if="kirigami"
subpackages="$pkgname-dev $pkgname-lang"
_repo_url="https://invent.kde.org/frameworks/qqc2-desktop-style.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/qqc2-desktop-style-$pkgver.tar.xz"

# tests segfault, see issue #16533
case "$CARCH" in
armv7) options="$options !check" ;;
esac

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_TESTING=ON
	cmake --build build
}

check() {
	xvfb-run -a ctest --test-dir build --output-on-failure -E "animationspeedmodifiertest"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
4660ee29d33d6140284267ff2cfdf2721fd437f1d4cf953448ed6b1368a9e068c60eb324acf407a7c5a7eb229a3956161162a7033d03bff4341b42080bec9eac  qqc2-desktop-style-6.7.0.tar.xz
"
